# Contributor: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor: simo <simo@archlinux.org>
# Contributor: Mateusz Herych <heniekk@gmail.com>
# Contributor: Tom Newsom <Jeepster@gmx.co.uk>

pkgname=oidentd
pkgver=3.0.0
pkgrel=1
pkgdesc='An RFC1413 compliant ident daemon'
arch=('loong64' 'x86_64')
url="https://oidentd.janikrabe.com/"
license=('GPL')
depends=('glibc' 'libnetfilter_conntrack')
backup=(etc/oidentd.conf)
source=(https://files.janikrabe.com/pub/oidentd/releases/$pkgver/oidentd-$pkgver.tar.xz{,.asc}
        service socket sysusers.conf)

md5sums=('b183cb70c65dbaf281e1da1e84d1e178'
         'SKIP'
         '8e1fec6ceece6bbf394381c58b531f76'
         '4442fb9fc10754914568e6ffc3d5fc42'
         '62cda7be7064da326e091bf7110c6ca4')

validpgpkeys=('63694DD76ED116B84D286F75C4CD3CE186D1CA13') # Janik Rabe

build() {
	cd oidentd-$pkgver
	./configure \
		--sysconfdir=/etc \
		--prefix=/usr \
		--sbindir=/usr/bin \
		--mandir=/usr/share/man
	make
}

package() {
	cd oidentd-$pkgver
	make DESTDIR="$pkgdir" install

	install -D -m644 "$srcdir"/service "$pkgdir"/usr/lib/systemd/system/oidentd@.service
	install -D -m644 "$srcdir"/socket "$pkgdir"/usr/lib/systemd/system/oidentd.socket
	install -D -m644 "$srcdir"/sysusers.conf "$pkgdir"/usr/lib/sysusers.d/oidentd.conf
}

